package com.mzx.edas.boot.controller;

import com.mzx.edas.boot.api.IHelloService;
import com.mzx.edas.boot.api.LocalDateService;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class DemoConsumerController {

    @Reference
    private IHelloService iHelloService;

    @Reference
    private LocalDateService localDateService;

    @RequestMapping("/sayHello/{name}")
    public String sayHello(@PathVariable String name) {
        return iHelloService.sayHello(name);
    }

    @RequestMapping("/getLocalTime")
    public String getLocalTime(){
        return localDateService.getLocalDateTimeStr();
    }

}
